<h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
  <%= devise_error_messages! %>

  <%= render :partial =>'form',:locals => {:f =>f} %>
<% if !current_client.password.blank? %>
  <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
  <%= f.password_field :password, :autocomplete => "off" %></div>

  <div><%= f.label :password_confirmation %><br />
  <%= f.password_field :password_confirmation %></div>

  <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
  <%= f.password_field :current_password %></div>

<% end %>

  <div><%= f.submit "Update" %></div>
<% end %>



<%= link_to "Back", :back %>

<script>
		jQuery(document).ready(function(){
			// binds form submission and fields to the validation engine
			jQuery("form").validationEngine('attach', {validationEventTrigger : false});
		});
</script>

